ERR Statement ---------------------------------------------------------------------------- Action Sets ERR to a specific value. Syntax ERR = n% Remarks The argument n% is an integer expression with a value between 1 and 255, inclusive, that specifies a run-time error code, or 0. When running an application program, BASIC uses ERR to record whether or not a run-time error has occurred and what the error was. When a program starts running, ERR is 0; when and if a run-time error occurs, BASIC sets ERR to the error code for that error. You may want to use the ERR statement to set ERR to a non-zero value to communicate error information between procedures. For example, you might use one of the run-time codes not used by BASIC as an application-specific error code. See Table 4.1, "Run-Time Error Codes," for a list of the run-time error codes that BASIC uses; they are a subset of the integers between 1 and 255, inclusive. Besides the ERR statement, the following BASIC statements set ERR whenever they execute. - Any form of the RESUME statement sets ERR to 0. - EXIT SUB, EXIT FUNCTION, or EXIT DEF sets ERR to 0 if executed within a procedure-level error handler. - All uses of the ON ERROR or ON LOCAL ERROR statements syntax set ERR to 0. - The ERROR statement can be used to set ERR to any value as part of simulating any run-time error. See Also ERR, ERL; ERROR; Table 4.1, "Run-Time Error Codes" Example See the ON ERROR statement programming example, which uses the ERR statement.